﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Evoucher.Business.Models;
using System.Web;

namespace Evoucher.Business.PaymentGateways
{
    public interface IPaymentGateway
    {
        double VerifyTransaction(string RefNum, string MerchantId);
    }

    public static class PaymentGatewayFactory
    {
        public static IPaymentGateway CreateGateway(int id)
        {
            switch (id)
            {
                case 1:
                    return new SB24PaymentGateway();
                case 2:
                    return new EnBankPaymentGateway();
                default:
                    throw new ArgumentException("Invalid Gateway id: " + id.ToString());
            }
        }
    }

    /* Mock Object Only For test purposes
     
    public class TestPaymentGateway : IPaymentGateway
    {

        public double VerifyTransaction(string RefNum, string MerchantId)
        {
            Transaction temp = (Transaction)HttpContext.Current.Session["transaction"];

            return temp.Amount.Value;
        }
    }
     */
}
